home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD006b.dsk
/
AMOUNT.WRITEOUT.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
3KB
|
51 lines
100 REM * AMOUNT WRITEOUT *
110 REM * BY *
120 REM * JAMES W. SMITH *
130 REM ***********************
140 HOME : PRINT "THIS SUBROUTINE WILL RETURN A LONGFORM PRINTOUT OF AN AMOUNT"
150 PRINT : PRINT "IT WOULD BE USEFUL WITH A CHECKWRITING PROGRAM OR OTHER WHERE DATA IS IN THE FORM OF A DOLLAR AMOUNT AS STRING V$
160 PRINT : PRINT "SINCE THE RETURNED STRING IS OFTEN WIDER THE 40-COLUMN MONITOR SCREEN, IT WILL BE BETTER TO RUN IT ON YOUR PRINTER"
170 PRINT : HTAB 2: PRINT "DO YOU WANT PRINTER OR MONITOR (P/M) ": GET X$
180 IF LEFT$(X$,1) = "P" THEN HOME : VTAB 2: PRINT "WHAT SLOT NUMBER IS YOUR PRINTER ": GET SL$
190 SL = VAL(SL$)
200 HOME : PRINT "WHAT IS THE AMOUNT YOU WISH TO WRITE OUT": PRINT TAB( 3);"BE SURE TO USE FOLLOWING FORM: 135.89"
210 PRINT : PRINT TAB( 3);"ELIMINATE $ SIGN AND COMMAS
220 PRINT : PRINT "NOTE: AMOUNT MUST BE POSITIVE AND BE- TWEEN 0.00 AND 90000.00"
230 PRINT : PRINT
240 INPUT "AMOUNT: ";V$: PRINT : PRINT "NOW, TURN ON PRINTER, SET PAGE LOCATION AND HIT ANY KEY": GET Z$: PR# SL
250 GOSUB 1000
260 END
1000 GOSUB 15000: PRINT : PRINT
1010 PRINT WW$: RETURN
15000 AW$ = V$:AW = VAL(V$)
15010 ON LEN(AW$) -2 GOSUB 15160,15120,15100,15070,15040,15030
15020 RETURN
15030 GOTO 15100
15040 GOSUB 15240: IF PW$ = "" THEN GOTO 15070
15050 WW$ = WW$ +" THOUSAND, "
15060 GOSUB 15250
15070 GOSUB 15240: IF PW$ = "" THEN GOTO 15090
15080 WW$ = WW$ +" HUNDRED, "
15090 GOSUB 15250
15100 GOSUB 15220: GOSUB 15250
15110 IF WX = 1 THEN RESTORE :PW = VAL( LEFT$(AW$,1)): FOR X = 1 TO 10: READ PW$: NEXT : FOR X = 0 TO PW: READ PW$: NEXT :WW$ = WW$ +PW$
15120 IF WX < >1 THEN GOSUB 15240
15130 IF LEN(AW$) = 7 THEN GOSUB 15270: GOTO 15050
15140 IF RIGHT$(WW$,2) = ", " THEN WW$ = LEFT$(WW$, LEN(WW$) -2) +" "
15150 GOTO 15170
15160 WW$ = WW$ +"NONE"
15170 IF LEN(WW$) <46 THEN WW$ = WW$ +"-": GOTO 15170
15180 WW$ = WW$ +" AND "
15190 GOSUB 15260:WW$ = WW$ +AW$ +"/100"
15200 RETURN
15210 RESTORE : RETURN
15220 PW = VAL( LEFT$(AW$,1)):WX = PW: IF PW >1 THEN RESTORE : FOR X = 0 TO 20: READ PW$: NEXT : FOR X = 2 TO PW: READ PW$: NEXT :WW$ = WW$ +PW$
15230 RETURN
15240 PW = VAL( LEFT$(AW$,1)): GOSUB 15210: FOR X = 0 TO PW: READ PW$: NEXT :WW$ = WW$ +PW$: RETURN
15250 AW$ = RIGHT$(AW$,( LEN(AW$) -1)): RETURN
15260 AW$ = RIGHT$(AW$,2): RETURN
15270 IF RIGHT$(WW$,1) = "-" THEN WW$ = LEFT$(WW$, LEN(WW$) -1)
15280 RETURN
40010 DATA "",ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,TEN
40020 DATA ELEVEN,TWELVE,THIRTEEN,FOURTEEN,FIFTEEN,SIXTEEN,SEVENTEEN,EIGHTEEN,NINETEEN
40030 DATA "",TWENTY-,THIRTY-,FORTY-,FIFTY-,SIXTY-,SEVENTY-,EIGHTY-,NINETY-